package cn.hxzy.controller;


import cn.hxzy.common.Result;
import cn.hxzy.entity.order.AbnormalImage;
import cn.hxzy.service.AbnormalImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.servlet.http.HttpServlet;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hk
 * @since 2023-06-23
 */
@CrossOrigin
@RestController
@RequestMapping("/abnormalImage")
public class AbnormalImageController {

    @Autowired
    private AbnormalImageService abnormalImageService;

    @PostMapping("/abimage")
    public Result insertImage(@RequestBody AbnormalImage abnormalImage ){
        boolean save = abnormalImageService.save(abnormalImage);
        if (save) return Result.ok().message("新增图片成功！");
        return Result.error().message("上传失败！");
    }
}

